Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enabling logit scaling #221

Merged
merged 10 commits into from
Mar 10, 2023
Merged

enabling logit scaling #221

merged 10 commits into from
Mar 10, 2023

Conversation

vchiley
Copy link
Contributor

@vchiley vchiley commented Mar 9, 2023

enables scaling output logits; similar to a softmax "temperature"
the PaLM paper uses scale 1/sqrt(cfg.d_model) (see Sec 5 Weight initialization)

Implantation notes:
F.cross_entropy does not enable temperature.
Since we'd have to add it to the model anyway, I just made it a buffer so that it'd be part of the model state_dict.

@vchiley vchiley self-assigned this Mar 9, 2023
@vchiley vchiley requested a review from dakinggg March 9, 2023 21:37
@vchiley vchiley requested a review from abhi-mosaic March 10, 2023 16:44
Copy link
Contributor

@samhavens samhavens left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@vchiley vchiley merged commit 44ad8d5 into mosaicml:main Mar 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants